Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(preset): Aws lambda edge #1075

Closed
wants to merge 5 commits into from

Conversation

juankamilo
Copy link

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Add AWS Lambda@Edge to the preset.

The current aws-lambda preset is not compatible with the Lambda@Edge
This option is one of the most cost-effective on cloud technologies, it is much faster and more effective than "API Gateway".
I take WinterYukky job as a base, focusing more on ".output/server/index.mjs" and removing the zero config functionalities as there are several CloudFormation templates to deploy, leaving a simpler option to implement inside your CI/CD.

Resolves #79

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@nuxt-studio
Copy link
Contributor

nuxt-studio bot commented Mar 21, 2023

βœ… Live Preview ready!

Name Edit Preview Latest Commit
nitro Edit on Studio β†—οΈŽ View Live Preview b5b8599

@juankamilo juankamilo changed the title Aws lambda edge feat(preset): Aws lambda edge Mar 21, 2023
@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #1075 (b5b8599) into main (1d0c120) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1075      +/-   ##
==========================================
+ Coverage   76.64%   76.66%   +0.01%     
==========================================
  Files          71       72       +1     
  Lines        7241     7247       +6     
  Branches      723      723              
==========================================
+ Hits         5550     5556       +6     
  Misses       1690     1690              
  Partials        1        1              
Impacted Files Coverage Ξ”
src/presets/aws-lambda-edge.ts 100.00% <100.00%> (ΓΈ)
src/presets/cloudflare-module.ts 100.00% <100.00%> (ΓΈ)
src/presets/cloudflare.ts 100.00% <100.00%> (ΓΈ)
src/presets/index.ts 100.00% <100.00%> (ΓΈ)

@anjali89r
Copy link

@pi0 can we get this PR merged soon ?

@galaxy79
Copy link

@pi0 @danielroe can we get a review and merge of this pr soon ?

@caiorhian
Copy link

Hey @pi0 do we have plans to get this merged for the next release? Our team is looking forward to use it.

Copy link
Contributor

@Hebilicious Hebilicious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

],
};
const res: CloudFrontResultResponse = await handler(event);
// responsed CloudFrontHeaders are special, so modify them for testing.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

@Hebilicious
Copy link
Contributor

Hebilicious commented Jul 3, 2023

This is looking very good, and it also would be a compatible with SST as demonstrated here https://github.com/jdevdevdev/nuxt-sst/blob/lambda-edge/nuxt-app/server/nitro/preset/entry.ts

@pi0 Some presets such as vercel and netlify have multiple presets, while some like cloudflare and azure don't, so I'm not sure what to do here.

AlbertSabate added a commit to AlbertSabate/nitro that referenced this pull request Dec 23, 2023
@pi0 pi0 marked this pull request as draft February 27, 2024 17:14
AlbertSabate added a commit to AlbertSabate/nitro that referenced this pull request Mar 29, 2024
Trying stuff

pnpm build conflicts with monorepo pnpm build when installing the package from github

Remove prepack and commit dist

Improve aws edge code

Accept only 1 header with same name for incoming headers

Forgot to build

Debugging outgoing headers

Improving the income headers

Removing dist
@juankamilo juankamilo closed this May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws lambda-edge
5 participants